package com.cch.cooperation.dao.bookkeeping.model;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 收支明细表
 *
 * @author cch on 2025-07-26
 */
@ApiModel("收支明细表")
@Data
public class Bookkeeping implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
    private String id;

    @ApiModelProperty(value = "空间id")
    private String zoneId;

    @ApiModelProperty(value = "用户id", hidden = true)
    @NotEmpty(message = "用户id不能为空")
    private String userId;

    @ApiModelProperty("类别Id")
    @NotEmpty(message = "类别id不能为空")
    private String categoryId;

    @ApiModelProperty("金额")
    @NotNull(message = "金额不能为空")
    private BigDecimal amount;

    @ApiModelProperty(value = "流水号")
    private String billNo;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("流水类型（1.支出 2.收入）")
    @NotNull(message = "流水类型不能为空")
    private Integer type;

    @ApiModelProperty("流水日期，格式：yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date date;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "修改时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    public static final String ID = "id";
    public static final String USER_ID = "user_id";
    public static final String CATEGORY = "category";
    public static final String AMOUNT = "amount";
    public static final String REMARK = "remark";
    public static final String TYPE = "type";
    public static final String DATE = "date";
    public static final String CREATE_TIME = "create_time";

}